import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/accident_info_entity.dart';

AccidentInfoEntity $AccidentInfoEntityFromJson(Map<String, dynamic> json) {
  final AccidentInfoEntity accidentInfoEntity = AccidentInfoEntity();
  final String? accidentCode = jsonConvert.convert<String>(json['accidentCode']);
  if (accidentCode != null) {
    accidentInfoEntity.accidentCode = accidentCode;
  }
  final String? accidentLevel = jsonConvert.convert<String>(json['accidentLevel']);
  if (accidentLevel != null) {
    accidentInfoEntity.accidentLevel = accidentLevel;
  }
  final String? accidentLevelName = jsonConvert.convert<String>(json['accidentLevelName']);
  if (accidentLevelName != null) {
    accidentInfoEntity.accidentLevelName = accidentLevelName;
  }
  final String? accidentName = jsonConvert.convert<String>(json['accidentName']);
  if (accidentName != null) {
    accidentInfoEntity.accidentName = accidentName;
  }
  final String? accidentOverview = jsonConvert.convert<String>(json['accidentOverview']);
  if (accidentOverview != null) {
    accidentInfoEntity.accidentOverview = accidentOverview;
  }
  final String? accidentSource = jsonConvert.convert<String>(json['accidentSource']);
  if (accidentSource != null) {
    accidentInfoEntity.accidentSource = accidentSource;
  }
  final String? accidentSourceName = jsonConvert.convert<String>(json['accidentSourceName']);
  if (accidentSourceName != null) {
    accidentInfoEntity.accidentSourceName = accidentSourceName;
  }
  final String? accidentType = jsonConvert.convert<String>(json['accidentType']);
  if (accidentType != null) {
    accidentInfoEntity.accidentType = accidentType;
  }
  final String? accidentTypeName = jsonConvert.convert<String>(json['accidentTypeName']);
  if (accidentTypeName != null) {
    accidentInfoEntity.accidentTypeName = accidentTypeName;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    accidentInfoEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    accidentInfoEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    accidentInfoEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    accidentInfoEntity.createDate = createDate;
  }
  final int? deathNum = jsonConvert.convert<int>(json['deathNum']);
  if (deathNum != null) {
    accidentInfoEntity.deathNum = deathNum;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    accidentInfoEntity.deleted = deleted;
  }
  final String? disposalStatus = jsonConvert.convert<String>(json['disposalStatus']);
  if (disposalStatus != null) {
    accidentInfoEntity.disposalStatus = disposalStatus;
  }
  final String? disposalStatusName = jsonConvert.convert<String>(json['disposalStatusName']);
  if (disposalStatusName != null) {
    accidentInfoEntity.disposalStatusName = disposalStatusName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    accidentInfoEntity.id = id;
  }
  final String? latitude = jsonConvert.convert<String>(json['latitude']);
  if (latitude != null) {
    accidentInfoEntity.latitude = latitude;
  }
  final String? longitude = jsonConvert.convert<String>(json['longitude']);
  if (longitude != null) {
    accidentInfoEntity.longitude = longitude;
  }
  final int? minorInjuryNum = jsonConvert.convert<int>(json['minorInjuryNum']);
  if (minorInjuryNum != null) {
    accidentInfoEntity.minorInjuryNum = minorInjuryNum;
  }
  final String? reportingStatus = jsonConvert.convert<String>(json['reportingStatus']);
  if (reportingStatus != null) {
    accidentInfoEntity.reportingStatus = reportingStatus;
  }
  final String? reportingStatusName = jsonConvert.convert<String>(json['reportingStatusName']);
  if (reportingStatusName != null) {
    accidentInfoEntity.reportingStatusName = reportingStatusName;
  }
  final int? seriousInjuryNum = jsonConvert.convert<int>(json['seriousInjuryNum']);
  if (seriousInjuryNum != null) {
    accidentInfoEntity.seriousInjuryNum = seriousInjuryNum;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    accidentInfoEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    accidentInfoEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    accidentInfoEntity.updateDate = updateDate;
  }
  return accidentInfoEntity;
}

Map<String, dynamic> $AccidentInfoEntityToJson(AccidentInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['accidentCode'] = entity.accidentCode;
  data['accidentLevel'] = entity.accidentLevel;
  data['accidentLevelName'] = entity.accidentLevelName;
  data['accidentName'] = entity.accidentName;
  data['accidentOverview'] = entity.accidentOverview;
  data['accidentSource'] = entity.accidentSource;
  data['accidentSourceName'] = entity.accidentSourceName;
  data['accidentType'] = entity.accidentType;
  data['accidentTypeName'] = entity.accidentTypeName;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deathNum'] = entity.deathNum;
  data['deleted'] = entity.deleted;
  data['disposalStatus'] = entity.disposalStatus;
  data['disposalStatusName'] = entity.disposalStatusName;
  data['id'] = entity.id;
  data['latitude'] = entity.latitude;
  data['longitude'] = entity.longitude;
  data['minorInjuryNum'] = entity.minorInjuryNum;
  data['reportingStatus'] = entity.reportingStatus;
  data['reportingStatusName'] = entity.reportingStatusName;
  data['seriousInjuryNum'] = entity.seriousInjuryNum;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension AccidentInfoEntityExtension on AccidentInfoEntity {
  AccidentInfoEntity copyWith({
    String? accidentCode,
    String? accidentLevel,
    String? accidentLevelName,
    String? accidentName,
    String? accidentOverview,
    String? accidentSource,
    String? accidentSourceName,
    String? accidentType,
    String? accidentTypeName,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    int? deathNum,
    String? deleted,
    String? disposalStatus,
    String? disposalStatusName,
    String? id,
    String? latitude,
    String? longitude,
    int? minorInjuryNum,
    String? reportingStatus,
    String? reportingStatusName,
    int? seriousInjuryNum,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return AccidentInfoEntity()
      ..accidentCode = accidentCode ?? this.accidentCode
      ..accidentLevel = accidentLevel ?? this.accidentLevel
      ..accidentLevelName = accidentLevelName ?? this.accidentLevelName
      ..accidentName = accidentName ?? this.accidentName
      ..accidentOverview = accidentOverview ?? this.accidentOverview
      ..accidentSource = accidentSource ?? this.accidentSource
      ..accidentSourceName = accidentSourceName ?? this.accidentSourceName
      ..accidentType = accidentType ?? this.accidentType
      ..accidentTypeName = accidentTypeName ?? this.accidentTypeName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deathNum = deathNum ?? this.deathNum
      ..deleted = deleted ?? this.deleted
      ..disposalStatus = disposalStatus ?? this.disposalStatus
      ..disposalStatusName = disposalStatusName ?? this.disposalStatusName
      ..id = id ?? this.id
      ..latitude = latitude ?? this.latitude
      ..longitude = longitude ?? this.longitude
      ..minorInjuryNum = minorInjuryNum ?? this.minorInjuryNum
      ..reportingStatus = reportingStatus ?? this.reportingStatus
      ..reportingStatusName = reportingStatusName ?? this.reportingStatusName
      ..seriousInjuryNum = seriousInjuryNum ?? this.seriousInjuryNum
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
